import Vue from 'vue'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
// import VueRouter from 'vue-router'
import VueRouter from '../my-vue-router/index.js'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: About,
    children: [
      {
        path: 'a',
        name: 'A',
        component: {render: h => <div>about a</div>},
      },
      {
        path: 'b',
        name: 'B',
        component: {render: h => <div>about b</div>},
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history', // hash / history
  base: process.env.BASE_URL,
  routes
})

export default router
